package com.margo.project.security.controller;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.margo.project.security.config.MargoJwtTokenFilter;
import com.margo.project.security.util.JwtUtils;

@CrossOrigin(maxAge = 3600)
@RestController
@RequestMapping("/user")
public class MargoUserController {
	
	Logger logger=LoggerFactory.getLogger(this.getClass());
	
	@RequestMapping("login")
    public String login(String username,String password){
		logger.info("登陆接口");
		String token=MargoJwtTokenFilter.tokenHead+JwtUtils.createJwtToken(username);
        System.out.println(token);
        return token;
    }
}
